package org.luxor.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.luxor.commons.core.validator.group.UpdateGroup;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;


/**
 * 组织部门
 *
 * @author Mark @date 2020-07-28 14:29:26
 */
@Data
@TableName("tb_sys_dept")
@ApiModel(description = "组织部门")
public class SysDeptEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键Id")
    @NotNull(message = "部门 ID，不能为空", groups = UpdateGroup.class)
    private Long id;

    @ApiModelProperty(value = "租户ID")
    private Long tenantId;

    @ApiModelProperty(value = "组织名称")
    @NotBlank(message = "deptName，不能为空")
    private String deptName;

    @ApiModelProperty(value = "上级部门ID，一级部门为0")
    @NotNull(message = "parentId，不能为空")
    private Long parentId;

    @ApiModelProperty(value = "组织类型(0-通用部门(dept)；1-企事业单位(org)；2-国家行政区(region))")
    private Byte type;

    @ApiModelProperty(value = "层级")
    private Integer level;

    @ApiModelProperty(value = "图标", hidden = true)
    private Byte[] icon;

    @ApiModelProperty(value = "检索关键字")
    private String keyword;

    @ApiModelProperty(value = "排序")
    private Integer orderNo;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "是否启动(1-启用；0-禁用)")
    private Boolean enabled;

    @ApiModelProperty(value = "逻辑删除(1-删除；0-未删除)")
    private Boolean deleted;

}
